/*

Boost Software License - Version 1.0 - August 17th, 2003

Permission is hereby granted, free of charge, to any person or organization
obtaining a copy of the software and accompanying documentation covered by
this license (the "Software") to use, reproduce, display, distribute,
execute, and transmit the Software, and to prepare derivative works of the
Software, and to permit third-parties to whom the Software is furnished to
do so, all subject to the following:

The copyright notices in the Software and this entire statement, including
the above license grant, this restriction and the following disclaimer,
must be included in all copies of the Software, in whole or in part, and
all derivative works of the Software, unless such copies or derivative
works are solely in the form of machine-executable object code generated by
a source language processor.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.

*/
module derelict.freeglut.functions;

// Callbacks used as parameters to some of the functions below.
extern(C)
{
    alias nothrow void function(int) da_intCallback;
    alias nothrow void function(int,int) da_2intCallback;
    alias nothrow void function(int,int,int) da_3intCallback;
    alias nothrow void function(int,int,int,int) da_4intCallback;
    alias nothrow void function(int,int,int,int,int) da_5intCallback;
    alias nothrow void function() da_voidCallback;
    alias nothrow void function(ubyte,int,int) da_keyboardCallback;
    alias nothrow void function(uint,int,int,int) da_joytstickCallback;
    alias nothrow void function(const(char)*,void*) da_printCallback;
}

extern(System)
{
    // From freeglut_std.h
    alias nothrow void function(int*,char**) da_glutInit;
    alias nothrow void function(int,int) da_glutInitWindowPosition;
    alias nothrow void function(int,int) da_glutInitWindowSize;
    alias nothrow void function(uint) da_glutInitDisplayMode;
    alias nothrow void function(const(char)*) da_glutInitDisplayString;

    alias nothrow void function() da_glutMainLoop;
    alias nothrow int function(const(char)*) da_glutCreateWindow;
    alias nothrow int function(int,int,int,int,int) da_glutCreateSubWindow;
    alias nothrow void function(int) da_glutDestroyWindow;
    alias nothrow void function(int) da_glutSetWindow;
    alias nothrow int function() da_glutGetWindow;
    alias nothrow void function(const(char)*) da_glutSetWindowTitle;
    alias nothrow void function(const(char)*) da_glutSetIconTitle;
    alias nothrow void function(int,int) da_glutReshapeWindow;
    alias nothrow void function(int,int) da_glutPositionWindow;
    alias nothrow void function() da_glutShowWindow;
    alias nothrow void function() da_glutHideWindow;
    alias nothrow void function() da_glutIconifyWindow;
    alias nothrow void function() da_glutPushWindow;
    alias nothrow void function() da_glutPopWindow;
    alias nothrow void function() da_glutFullScreen;

    alias nothrow void function(int) da_glutPostWindowRedisplay;
    alias nothrow void function() da_glutPostRedisplay;
    alias nothrow void function() da_glutSwapBuffers;

    alias nothrow void function(int,int) da_glutWarpPointer;
    alias nothrow void function(int) da_glutSetCursor;

    alias nothrow void function() da_glutEstablishOverlay;
    alias nothrow void function() da_glutRemoveOverlay;
    alias nothrow void function(uint) da_glutUseLayer;
    alias nothrow void function() da_glutPostOverlayRedisplay;
    alias nothrow void function(int) da_glutPostWindowOverlayRedisplay;
    alias nothrow void function() da_glutShowOverlay;
    alias nothrow void function() da_glutHideOverlay;

    alias nothrow int function(da_intCallback) da_glutCreateMenu;
    alias nothrow void function(int) da_glutDestroyMenu;
    alias nothrow int function() da_glutGetMenu;
    alias nothrow void function(int) da_glutSetMenu;
    alias nothrow void function(const(char)*,int) da_glutAddMenuEntry;
    alias nothrow void function(const(char)*,int) da_glutAddSubMenu;
    alias nothrow void function(int,const(char)*,int) da_glutChangeToMenuEntry;
    alias nothrow void function(int,const(char)*,int) da_glutChangeToSubMenu;
    alias nothrow void function(int) da_glutRemoveMenuItem;
    alias nothrow void function(int) da_glutAttachMenu;
    alias nothrow void function(int) da_glutDetachMenu;

    alias nothrow void function(uint,da_intCallback,int) da_glutTimerFunc;
    alias nothrow void function(da_voidCallback) da_glutIdleFunc;

    alias nothrow void function(da_keyboardCallback) da_glutKeyboardFunc;
    alias nothrow void function(da_3intCallback) da_glutSpecialFunc;
    alias nothrow void function(da_2intCallback) da_glutReshapeFunc;
    alias nothrow void function(da_intCallback) da_glutVisibilityFunc;
    alias nothrow void function(da_voidCallback) da_glutDisplayFunc;
    alias nothrow void function(da_4intCallback) da_glutMouseFunc;
    alias nothrow void function(da_2intCallback) da_glutMotionFunc;
    alias nothrow void function(da_2intCallback) da_glutPassiveMotionFunc;
    alias nothrow void function(da_intCallback) da_glutEntryFunc;

    alias nothrow void function(da_keyboardCallback) da_glutKeyboardUpFunc;
    alias nothrow void function(da_3intCallback) da_glutSpecialUpFunc;
    alias nothrow void function(da_joytstickCallback) da_glutJoystickFunc;
    alias nothrow void function(da_intCallback) da_glutMenuStateFunc;
    alias nothrow void function(da_3intCallback) da_glutMenuStatusFunc;
    alias nothrow void function(da_voidCallback) da_glutOverlayDisplayFunc;
    alias nothrow void function(da_intCallback) da_glutWindowStatusFunc;

    alias nothrow void function(da_3intCallback) da_glutSpaceballMotionFunc;
    alias nothrow void function(da_3intCallback) da_glutSpaceballRotateFunc;
    alias nothrow void function(da_2intCallback) da_glutSpaceballButtonFunc;
    alias nothrow void function(da_2intCallback) da_glutButtonBoxFunc;
    alias nothrow void function(da_2intCallback) da_glutDialsFunc;
    alias nothrow void function(da_2intCallback) da_glutTabletMotionFunc;
    alias nothrow void function(da_4intCallback) da_glutTabletButtonFunc;

    alias nothrow int function(uint) da_glutGet;
    alias nothrow int function(uint) da_glutDeviceGet;
    alias nothrow int function() da_glutGetModifiers;
    alias nothrow int function(uint) da_glutLayerGet;

    alias nothrow void function(void*,int) da_glutBitmapCharacter;
    alias nothrow int function(void*,int) da_glutBitmapWidth;
    alias nothrow void function(void*,int) da_glutStrokeCharacter;
    alias nothrow int function(void*,int) da_glutStrokeWidth;
    alias nothrow int function(void*, const(char)*) da_glutBitmapLength;
    alias nothrow int function(void*,const(char)*) da_glutStrokeLength;

    alias nothrow void function(double) da_glutWireCube;
    alias nothrow void function(double) da_glutSolidCube;
    alias nothrow void function(double,int,int) da_glutWireSphere;
    alias nothrow void function(double,int,int) da_glutSolidSphere;
    alias nothrow void function(double,double,int,int) da_glutWireCone;
    alias nothrow void function(double,double,int,int) da_glutSolidCone;

    alias nothrow void function(double,double,int,int) da_glutWireTorus;
    alias nothrow void function(double,double,int,int) da_glutSolidTorus;
    alias nothrow void function() da_glutWireDodecahedron;
    alias nothrow void function() da_glutSolidDodecahedron;
    alias nothrow void function() da_glutWireOctahedron;
    alias nothrow void function() da_glutSolidOctahedron;
    alias nothrow void function() da_glutWireTetrahedron;
    alias nothrow void function() da_glutSolidTetrahedron;
    alias nothrow void function() da_glutWireIcosahedron;
    alias nothrow void function() da_glutSolidIcosahedron;

    alias nothrow void function(double) da_glutWireTeapot;
    alias nothrow void function(double) da_glutSolidTeapot;

    alias nothrow void function(const(char)*) da_glutGameModeString;
    alias nothrow int function() da_glutEnterGameMode;
    alias nothrow void function() da_glutLeaveGameMode;
    alias nothrow int function(uint) da_glutGameModeGet;

    alias nothrow int function(uint) da_glutVideoResizeGet;
    alias nothrow void function() da_glutSetupVideoResizing;
    alias nothrow void function() da_glutStopVideoResizing;
    alias nothrow void function(int,int,int,int) da_glutVideoResize;
    alias nothrow void function(int,int,int,int) da_glutVideoPan;

    alias nothrow void function(int,float,float,float) da_glutSetColor;
    alias nothrow float function(int,int) da_glutGetColor;
    alias nothrow void function(int) da_glutCopyColormap;

    alias nothrow void function(int) da_glutIgnoreKeyRepeat;
    alias nothrow void function(int) da_glutSetKeyRepeat;
    alias nothrow void function() da_glutForceJoystickFunc;

    alias nothrow int function(const(char)*) da_glutExtensionSupported;
    alias nothrow void function() da_glutReportErrors;

    // From freeglut_ext.h
    alias nothrow void function() da_glutMainLoopEvent;
    alias nothrow void function() da_glutLeaveMainLoop;
    alias nothrow void function() da_glutExit;

    alias nothrow void function() da_glutFullScreenToggle;
    alias nothrow void function() da_glutLeaveFullScreen;

    alias nothrow void function(da_4intCallback) da_glutMouseWheelFunc;
    alias nothrow void function(da_voidCallback) da_glutCloseFunc;
    alias nothrow void function(da_voidCallback) da_glutWMCloseFunc;
    alias nothrow void function(da_voidCallback) da_glutMenuDestroyFunc;

    alias nothrow void function(uint,int) da_glutSetOption;
    alias nothrow int* function(uint,int*) da_glutGetModeValues;
    alias nothrow void* function() da_glutGetWindowData;
    alias nothrow void function(void*) da_glutSetWindowData;
    alias nothrow void* function() da_glutGetMenuData;
    alias nothrow void function(void*) da_glutSetMenuData;

    alias nothrow int function(void*) da_glutBitmapHeight;
    alias nothrow float function(void*) da_glutStrokeHeight;
    alias nothrow void function(void*,const(char)*) da_glutBitmapString;
    alias nothrow void function(void*,const(char)*) da_glutStrokeString;

    alias nothrow void function() da_glutWireRhombicDodecahedron;
    alias nothrow void function() da_glutSolidRhombicDodecahedron;
    alias nothrow void function(int,double[3],double) da_glutWireSierpinskiSponge;
    alias nothrow void function(int,double[3],double) da_glutSolidSierpinskiSponge;
    alias nothrow void function(double,double,int,int) da_glutWireCylinder;
    alias nothrow void function(double,double,int,int) da_glutSolidCylinder;

    alias nothrow void* function(const(char)*) da_glutGetProcAddress;

    alias nothrow void function(da_2intCallback) da_glutMultiEntryFunc;
    alias nothrow void function(da_5intCallback) da_glutMultiButtonFunc;
    alias nothrow void function(da_3intCallback) da_glutMultiMotionFunc;
    alias nothrow void function(da_3intCallback) da_glutMultiPassiveFunc;

    alias nothrow void function(int,int) da_glutInitContextVersion;
    alias nothrow void function(int) da_glutInitContextFlags;
    alias nothrow void function(int) da_glutInitContextProfile;

    alias nothrow void function(da_printCallback) da_glutInitErrorFunc;
    alias nothrow void function(da_printCallback) da_glutInitWarningFunc;
}

__gshared
{
    da_glutInit glutInit;
    da_glutInitWindowPosition glutInitWindowPosition;
    da_glutInitWindowSize glutInitWindowSize;
    da_glutInitDisplayMode glutInitDisplayMode;
    da_glutInitDisplayString glutInitDisplayString;

    da_glutMainLoop glutMainLoop;

    da_glutCreateWindow glutCreateWindow;
    da_glutCreateSubWindow glutCreateSubWindow;
    da_glutDestroyWindow glutDestroyWindow;
    da_glutSetWindow glutSetWindow;
    da_glutGetWindow glutGetWindow;
    da_glutSetWindowTitle glutSetWindowTitle;
    da_glutSetIconTitle glutSetIconTitle;
    da_glutReshapeWindow glutReshapeWindow;
    da_glutPositionWindow glutPositionWindow;
    da_glutShowWindow glutShowWindow;
    da_glutHideWindow glutHideWindow;
    da_glutIconifyWindow glutIconifyWindow;
    da_glutPushWindow glutPushWindow;
    da_glutPopWindow glutPopWindow;
    da_glutFullScreen glutFullScreen;

    da_glutPostWindowRedisplay glutPostWindowRedisplay;
    da_glutPostRedisplay glutPostRedisplay;
    da_glutSwapBuffers glutSwapBuffers;

    da_glutWarpPointer glutWarpPointer;
    da_glutSetCursor glutSetCursor;

    da_glutEstablishOverlay glutEstablishOverlay;
    da_glutRemoveOverlay glutRemoveOverlay;
    da_glutUseLayer glutUseLayer;
    da_glutPostOverlayRedisplay glutPostOverlayRedisplay;
    da_glutPostWindowOverlayRedisplay glutPostWindowOverlayRedisplay;
    da_glutShowOverlay glutShowOverlay;
    da_glutHideOverlay glutHideOverlay;

    da_glutCreateMenu glutCreateMenu;
    da_glutDestroyMenu glutDestroyMenu;
    da_glutGetMenu glutGetMenu;
    da_glutSetMenu glutSetMenu;
    da_glutAddMenuEntry glutAddMenuEntry;
    da_glutAddSubMenu glutAddSubMenu;
    da_glutChangeToMenuEntry glutChangeToMenuEntry;
    da_glutChangeToSubMenu glutChangeToSubMenu;
    da_glutRemoveMenuItem glutRemoveMenuItem;
    da_glutAttachMenu glutAttachMenu;
    da_glutDetachMenu glutDetachMenu;

    da_glutTimerFunc glutTimerFunc;
    da_glutIdleFunc glutIdleFunc;

    da_glutKeyboardFunc glutKeyboardFunc;
    da_glutSpecialFunc glutSpecialFunc;
    da_glutReshapeFunc glutReshapeFunc;
    da_glutVisibilityFunc glutVisibilityFunc;
    da_glutDisplayFunc glutDisplayFunc;
    da_glutMouseFunc glutMouseFunc;
    da_glutMotionFunc glutMotionFunc;
    da_glutPassiveMotionFunc glutPassiveMotionFunc;
    da_glutEntryFunc glutEntryFunc;

    da_glutKeyboardUpFunc glutKeyboardUpFunc;
    da_glutSpecialUpFunc glutSpecialUpFunc;
    da_glutJoystickFunc glutJoystickFunc;
    da_glutMenuStateFunc glutMenuStateFunc;
    da_glutMenuStatusFunc glutMenuStatusFunc;
    da_glutOverlayDisplayFunc glutOverlayDisplayFunc;
    da_glutWindowStatusFunc glutWindowStatusFunc;

    da_glutSpaceballMotionFunc glutSpaceballMotionFunc;
    da_glutSpaceballRotateFunc glutSpaceballRotateFunc;
    da_glutSpaceballButtonFunc glutSpaceballButtonFunc;
    da_glutButtonBoxFunc glutButtonBoxFunc;
    da_glutDialsFunc glutDialsFunc;
    da_glutTabletMotionFunc glutTabletMotionFunc;
    da_glutTabletButtonFunc glutTabletButtonFunc;

    da_glutGet glutGet;
    da_glutDeviceGet glutDeviceGet;
    da_glutGetModifiers glutGetModifiers;
    da_glutLayerGet glutLayerGet;

    da_glutBitmapCharacter glutBitmapCharacter;
    da_glutBitmapWidth glutBitmapWidth;
    da_glutStrokeCharacter glutStrokeCharacter;
    da_glutStrokeWidth glutStrokeWidth;
    da_glutBitmapLength glutBitmapLength;
    da_glutStrokeLength glutStrokeLength;

    da_glutWireCube glutWireCube;
    da_glutSolidCube glutSolidCube;
    da_glutWireSphere glutWireSphere;
    da_glutSolidSphere glutSolidSphere;
    da_glutWireCone glutWireCone;
    da_glutSolidCone glutSolidCone;

    da_glutWireTorus glutWireTorus;
    da_glutSolidTorus glutSolidTorus;
    da_glutWireDodecahedron glutWireDodecahedron;
    da_glutSolidDodecahedron glutSolidDodecahedron;
    da_glutWireOctahedron glutWireOctahedron;
    da_glutSolidOctahedron glutSolidOctahedron;
    da_glutWireTetrahedron glutWireTetrahedron;
    da_glutSolidTetrahedron glutSolidTetrahedron;
    da_glutWireIcosahedron glutWireIcosahedron;
    da_glutSolidIcosahedron glutSolidIcosahedron;

    da_glutWireTeapot glutWireTeapot;
    da_glutSolidTeapot glutSolidTeapot;

    da_glutGameModeString glutGameModeString;
    da_glutEnterGameMode glutEnterGameMode;
    da_glutLeaveGameMode glutLeaveGameMode;
    da_glutGameModeGet glutGameModeGet;

    da_glutVideoResizeGet glutVideoResizeGet;
    da_glutSetupVideoResizing glutSetupVideoResizing;
    da_glutStopVideoResizing glutStopVideoResizing;
    da_glutVideoResize glutVideoResize;
    da_glutVideoPan glutVideoPan;

    da_glutSetColor glutSetColor;
    da_glutGetColor glutGetColor;
    da_glutCopyColormap glutCopyColormap;

    da_glutIgnoreKeyRepeat glutIgnoreKeyRepeat;
    da_glutSetKeyRepeat glutSetKeyRepeat;
    da_glutForceJoystickFunc glutForceJoystickFunc;

    da_glutExtensionSupported glutExtensionSupported;
    da_glutReportErrors glutReportErrors;

    da_glutMainLoopEvent glutMainLoopEvent;
    da_glutLeaveMainLoop glutLeaveMainLoop;
    da_glutExit glutExit;

    da_glutFullScreenToggle glutFullScreenToggle;
    da_glutLeaveFullScreen glutLeaveFullScreen;

    da_glutMouseWheelFunc glutMouseWheelFunc;
    da_glutCloseFunc glutCloseFunc;
    da_glutWMCloseFunc glutWMCloseFunc;
    da_glutMenuDestroyFunc glutMenuDestroyFunc;

    da_glutSetOption glutSetOption;
    da_glutGetModeValues glutGetModeValues;
    da_glutGetWindowData glutGetWindowData;
    da_glutSetWindowData glutSetWindowData;
    da_glutGetMenuData glutGetMenuData;
    da_glutSetMenuData glutSetMenuData;

    da_glutBitmapHeight glutBitmapHeight;
    da_glutStrokeHeight glutStrokeHeight;
    da_glutBitmapString glutBitmapString;
    da_glutStrokeString glutStrokeString;

    da_glutWireRhombicDodecahedron glutWireRhombicDodecahedron;
    da_glutSolidRhombicDodecahedron glutSolidRhombicDodecahedron;
    da_glutWireSierpinskiSponge glutWireSierpinskiSponge;
    da_glutSolidSierpinskiSponge glutSolidSierpinskiSponge;
    da_glutWireCylinder glutWireCylinder;
    da_glutSolidCylinder glutSolidCylinder;

    da_glutGetProcAddress glutGetProcAddress;

    da_glutMultiEntryFunc glutMultiEntryFunc;
    da_glutMultiButtonFunc glutMultiButtonFunc;
    da_glutMultiMotionFunc glutMultiMotionFunc;
    da_glutMultiPassiveFunc glutMultiPassiveFunc;

    da_glutInitContextVersion glutInitContextVersion;
    da_glutInitContextFlags glutInitContextFlags;
    da_glutInitContextProfile glutInitContextProfile;

    da_glutInitErrorFunc glutInitErrorFunc;
    da_glutInitWarningFunc glutInitWarningFunc;
}